<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//Route::group(['middleware'=>'web',function(){
//	Route::get('sessiontest',['uses'=>'IndexController@sessiontest']);
//}]);

Route::get('request',['uses'=>'IndexController@request']);
//Route::get('/', function () {
//	return view('welcome');
//});
//
////基础路由
//Route::get('get',function (){
//	return 'get';
//});
//Route::post('post',function (){
//	return 'post';
//});
////多请求路由
//Route::match(['get','post'],'match',function (){
//	return 'match多请求路由';
//});
//
////Route::get('/',function (){
////    return '我是你爸爸';
////});
//Route::any('any',function (){
//	return 'any多请求路由';
//});
//
////路由参数
////Route::get('user/{id}',function ($id){
////    return '参数'.$id;
////});
////路由参数可以是可选的
//Route::get("user/{id}/{name?}",function ($id,$name='joln'){
//	return "参数id=>".$id.",name=>".$name;
//})->where(['id'=>'[0-9]+','name'=>'[a-zA-Z]+']);
//
//Route::get('user/MemberCenter',['as'=>'center',function (){
//	return '别名'.route('center');
//}]);
//
//
//Route::group(
//	['prefix'=>'test'],function (){
//	Route::get('user/{id?}/{name}',function ($id='2',$name){
//		return 'id:'.$id.'name:'.$name;
//	})->where(['id'=>'[0-9]+','name'=>"[a-zA-Z]+"]);
//	Route::post('');
//});
//
////路由群组
//Route::group(['prefix'=>'shirt'],function (){
//	Route::get('user/member/{id}/{name?}',['as'=>'ucenter',function ($id,$name='john'){
//		return '路由群组center_id=>'.$id.',name=>'.$name;
//	}])->where(['id'=>'[0-9+]','name'=>'[a-z+]']);
//	Route::any('shirt/{id}/{name}',['as'=>'shirt',function($id,$name){
//		return '路由群组id=>'.$id.',name=>'.$name;
//	}])->where(['id'=>'[0-9]+','name'=>'[a-z]+']);
//});
//
//
////Route::get('shou','IndexController@index');
Route::get('/',['uses'=>'IndexController@index', 'as'=>'index']);
Route::get('/category',['uses'=>'IndexController@category','as'=>'category']);
//Route::get('db_curd',['uses'=>'IndexController@db_curd']);
//Route::get('insert',['uses'=>"IndexController@insert"]);
//Route::get("update",['uses'=>'IndexController@update']);
//Route::get("delete",['uses'=>'IndexController@delete']);
//Route::get("select",['uses'=>'IndexController@select']);
//Route::get("mash",['uses'=>'IndexController@mash']);
//Route::get('Ormindex',['uses'=>'IndexController@Orm']);
//Route::get('Orm',['uses'=>'UserinfoController@Orm']);
//Route::get('OrmMash',['uses'=>'IndexController@OrmMash']);
//Route::get('OrmInsert','IndexController@OrmInsert');
//Route::get('OrmUpdate','IndexController@OrmUpdate');
//Route::get('Ormdelete','IndexController@Ormdelete');
//Route::get('blade','IndexController@blade');
//Route::get('layout',function (){
//	return view('layout');
//});
//Route::get("url",['as'=>'ul','uses'=>'IndexController@urlTest']);
//Route::get('request',['as'=>'request','uses'=>'RequestController@request']);
//Route::get('User',['uses'=>'UserController@index']);


/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
//session 中间件
Route::group(['middleware' => ['web']], function () {
	Route::get('session1',['uses'=>'IndexController@session1']);
	Route::get('session2',['uses'=>'IndexController@session2']);
});
